﻿@Html.Hidden("urlSaveAppointment", Url.Action("SaveAppointment", "Appointment"))
@Html.Hidden("urlGetAppointments", Url.Action("GetAppointments", "Appointment"))
@Html.Hidden("urlGetEvents", Url.Action("GetEvents", "Appointment"))
@Html.Hidden("urlGetMedics", Url.Action("GetMedics", "Appointment"))
@Html.Hidden("urlGetConsultingRooms", Url.Action("GetConsultingRooms", "Appointment"))
@Html.Hidden("urlUpdateAppointment", Url.Action("UpdateAppointment", "Appointment"))
@Html.Hidden("urlGetAppointment", Url.Action("GetAppointment", "Appointment"))
@Html.Hidden("urlDeleteAppointment", Url.Action("DeleteAppointment", "Appointment"))
@Html.Hidden("urlGetPatients", Url.Action("GetPatients", "Reception"))
@Html.Hidden("urlSearchAppointments", Url.Action("SearchAppointments", "Appointment"))
@Html.Hidden("urlGetStatus", Url.Action("GetStatus", "Appointment"))
@Html.Hidden("urlUpdateAppointmentStatus", Url.Action("UpdateAppointmentStatus", "Appointment"))

@Html.Hidden("urlHome", Url.Action("Index", "Home"))
@Html.Hidden("urlAppointment", Url.Action("Index", "Appointment"))

<section class="grid_4" style="width: 18.333%">
	<div class="block-border">
        <div class="block-content">
		    <h1>Agenda de Citas</h1>
				
		    <div class="fieldset with-legend grey-bg clearfix">
			    
                @*<div class="float-left">*@
                    <div id="smallCalendar"></div>
                @*</div>*@

                @*<div class="next-to-mini-calendar form" style="margin-left: 0;">
                    <div class="columns">
					    <label for="ddlStatus">Filtar por estado de citas</label>
                        <select id="ddlStatus" name="ddlStatus">
                            <option value="">Todas</option>
                            <option value="1">Anuladas</option>
                            <option value="2">Confirmadas</option>
                            <option value="3">En sala de espera</option>
                            <option value="4">Atendido</option>
                            <option value="5">No asiste</option>
                        </select>
				    </div>
                </div>*@

		    </div>
				
		    <hr class="no-margin">
				
		    <div class="box block-content form" id="pnlFilters" style="display: none;">

                <h2>Filtros de búsqueda</h2>

                <div class="columns">
                    <input type="hidden" id="customerFilterID" name="customerFilterID" />
                    <label for="txtCustomerFilter">Filtar por paciente</label>

                    <p class='colx2-left'>
					    <span class='relative'>
						    <input type='radio' name='rdbSearchType' id='rdbNameFilter' value='name' checked='checked'> Nombre
					    </span>
				    </p>
				    <p class='colx2-right'>
                        <span class='relative'>
						    <input type='radio' name='rdbSearchType' id='rdbID' value='id'> Identificación
                        </span>
				    </p>

                    <input type='text' name='txtCustomerFilter' id='txtCustomerFilter' class="full-width" style="background-image:url(/ODSYSUI/Content/Images/Forms/Search.gif); background-position:left; background-repeat:no-repeat; background-position: right center;" maxlength="20">
                </div>

                <div class="columns">
					<label for="ddlMedic">Filtar por médico</label>
                    <select id="ddlMedic" name="ddlMedic" class="full-width">                        
                        <option value="">Todos</option>
                        @{
                            List<ViewModel.Models.vMedicViewModel> objList = (BLC.Controller.AppointmentBlc.GetMedicos(User.Identity.Name));// TempData["ddlMedic"];
                            foreach (ViewModel.Models.vMedicViewModel obj in objList)
                            {
                                 <option value="@obj.name">@obj.name @obj.firstName @obj.lastName (@obj.identification)</option>
                            }                               
                        }                        
                    </select>
                    
				</div>

                <div class="columns">
					<label for="ddlStatus">Filtar por estado de citas</label>
                    <select id="ddlStatus" name="ddlStatus" class="full-width">
                        <option value="">Todos</option>
                       @{
                           List<DAL.Models.AppointmentStatu> estadoCitaList = (List<DAL.Models.AppointmentStatu>)TempData["ddlStatus"];
                           foreach (DAL.Models.AppointmentStatu obj in estadoCitaList)
                            {
                                 <option value="@obj.appointmentStatusID">@obj.name</option>
                            }                               
                        }   
                    </select>
				</div>

                <div class="columns">
					<label for="ddlTimeSearch">Filtar por periodo</label>
                    <select id="ddlTimeSearch" name="ddlTimeSearch" class="full-width">
                        <option value="">Todos</option>
                        <option value="1">Todas a partir de hoy</option>
                        <option value="2">Solo antiguas</option>
                    </select>
				</div>

                <button id="btnSearch" type="button" onclick="SearchPatients();">Buscar</button>
		    </div>

            <div class="block-content" id="pnlAppointmentsList" style="display: none;">
				<ul id="lstEventsLists" class="blocks-list">
				</ul>
				
				<ul class="message no-margin">
					<li><span id="numAppointments"></span> Citas Encontradas</li>
				</ul>
			</div>

	    </div>

	</div>
</section>
